<%= render :partial => "/tr8n/admin/common/header" %>
<%= render :partial => "tabs" %>

<%=link_to("Calculate total metrics", {:action => :calculate_total_metrics}, :confirm => "Are you sure you want to run this opperation?")%>

<style>
	.chart {
    margin-top:10px;
		margin-bottom:10px;
		text-align:center;
		border: 1px dotted #ccc;
		padding:10px;
	}
	
	.chart_title {
		font-size:18px;
	}
</style>

<%
  charts = [
    ['Users by Language', :user_count],
    ['Translators by Language', :translator_count],
    ['Translations by Language', :translation_count],
    ['Translated Phrases by Language', :translated_key_count],
    ['Locked Phrases by Language', :locked_key_count]
  ].each do |chart|
%>

<div class="chart">
  <div class="chart_title"><%=chart.first%> (top 20)</div>
  <%= language_metric_chart(chart.last) %>
</div>

<% end %>